package info.tsukaworld.actor.mob.pathfinding;

import info.tsukaworld.grid.Location;

public abstract class Tile
{
    private final Location location;
    protected  Obstacle obstacle;

    public Tile(final Location loc)
    {
        location = loc;
    }

    public Location getLocation()
    {
        return (location);
    }

    public Obstacle getObstacle()
    {
        return (obstacle);
    }

    public final int hashCode()
    {
        return (location.hashCode());
    }

    public final boolean equals(final Object o)
    {
        final boolean retVal;

        if(this == o)
        {
            return (true);
        }

        if(o instanceof Tile)
        {
            final Tile other;

            other  = (Tile)o;
            retVal = location.equals(other.location);
        }
        else
        {
            retVal = false;
        }

        return (retVal);
    }

    public String toString()
    {
        return (location.toString() + " -> " + obstacle);
    }
}